package model

import (
	"api-getaway/basic/config"
	"gorm.io/gorm"
)

// 美容套餐表
type Beauty struct {
	gorm.Model
	Name           string  `gorm:"type:varchar(20);not null;comment:'美容名称'"`
	Types          string  `gorm:"type:varchar(20);not null;comment:'套餐类型'"`
	Price          float64 `gorm:"type:decimal(10,2);not null;comment:'价格'"`
	BeautyServices string  `gorm:"type:varchar(20);not null;comment:'服务包含'"`
}

// 宠物表
type Pet struct {
	gorm.Model
	Name    string  `gorm:"type:varchar(20);not null;comment:'宠物名称'"`
	Types   string  `gorm:"type:varchar(20);not null;comment:'宠物品种'"`
	Address string  `gorm:"type:varchar(20);not null;comment:'地址'"`
	Store   string  `gorm:"type:varchar(20);not null;comment:'门店'"`
	Price   float64 `gorm:"type:decimal(10,2);not null;comment:'总价'"`
}

func (p *Pet) CreatePet() error {
	return config.DB.Debug().Create(&p).Error
}

// 地址表
type Address struct {
	gorm.Model
	Name            string `gorm:"type:varchar(20);not null;comment:'名称'"`
	Mobile          string `gorm:"type:char(11);not null;comment:'手机号'"`
	DetailedAddress string `gorm:"type:varchar(100);not null;comment:'详细地址'"`
}
